/*
   Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
   Original sources are available at www.latestbit.com

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package org.latestbit.smartobjects.smartidlc.model;

import java.util.ArrayList;
import java.util.Collection;

public class IDLNamespace {
	private boolean referencesLinked = false;
	
	private String name;
	
	private Collection<String> importedNamespacesLinks = new ArrayList<String>();
	private Collection<IDLNamespace> importedNamespaces = new ArrayList<IDLNamespace>();
	
	private Collection<IDLTypeDef> typedefs = new ArrayList<IDLTypeDef>();
	private Collection<IDLEnum> enums = new ArrayList<IDLEnum>();
	private Collection<IDLStructure> structures = new ArrayList<IDLStructure>();
	private Collection<IDLException> exceptions = new ArrayList<IDLException>();
	private Collection<IDLChoice> choices = new ArrayList<IDLChoice>();	
	private Collection<IDLInterface> interfaces = new ArrayList<IDLInterface>();
	
	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public void setImportedNamespacesLinks(Collection<String> importedNamespacesLinks) {
		this.importedNamespacesLinks = importedNamespacesLinks;
	}
	
	public Collection<String> getImportedNamespacesLinks() {
		return importedNamespacesLinks;
	}
	
	public void setImportedNamespaces(Collection<IDLNamespace> importedNamespaces) {
		this.importedNamespaces = importedNamespaces;
	}
	
	public Collection<IDLNamespace> getImportedNamespaces() {
		return importedNamespaces;
	}
	
	public void setTypedefs(Collection<IDLTypeDef> typedefs) {
		this.typedefs = typedefs;
	}
	
	public Collection<IDLTypeDef> getTypedefs() {
		return typedefs;
	}
	
	public void setEnums(Collection<IDLEnum> enums) {
		this.enums = enums;
	}
	
	public Collection<IDLEnum> getEnums() {
		return enums;
	}
	
	public void setStructures(Collection<IDLStructure> structures) {
		this.structures = structures;
	}
	
	public Collection<IDLStructure> getStructures() {
		return structures;
	}
	
	public void setExceptions(Collection<IDLException> exceptions) {
		this.exceptions = exceptions;
	}

	public Collection<IDLException> getExceptions() {
		return exceptions;
	}

	public void setChoices(Collection<IDLChoice> choices) {
		this.choices = choices;
	}
	
	public Collection<IDLChoice> getChoices() {
		return choices;
	}
	
	public void setInterfaces(Collection<IDLInterface> interfaces) {
		this.interfaces = interfaces;
	}
	
	public Collection<IDLInterface> getInterfaces() {
		return interfaces;
	}

	public void merge(IDLNamespace srcNamespace) {
		this.choices.addAll ( srcNamespace.getChoices() );
		this.enums.addAll( srcNamespace.getEnums() );
		this.importedNamespaces.addAll( srcNamespace.getImportedNamespaces() );
		this.importedNamespacesLinks.addAll ( srcNamespace.getImportedNamespacesLinks() );
		this.interfaces.addAll ( srcNamespace.getInterfaces() );
		this.structures.addAll ( srcNamespace.getStructures() );
		this.typedefs.addAll ( srcNamespace.getTypedefs() );
	}

	public void setReferencesLinked(boolean referencesLinked) {
		this.referencesLinked = referencesLinked;
	}

	public boolean isReferencesLinked() {
		return referencesLinked;
	}

	
}
